$(function () {
    var gdp = function () {
        var option = {
            title: {
                text: 'GDP近两年总量与增长率比较',
                textStyle: {
                    fontSize: 24,
                    color: '#fff',
                    fontWeight: 100
                },
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow',
                    label: {
                        backgroundColor: '#6a7985'
                    }
                },
                textStyle: {
                    fontSize: 22
                }
            },
            grid: {
                top: '30%',
                left: '0%',
                right: '0%',
                bottom: '0%',
                containLabel: true
            },
            legend: [{
                x: 'center',
                data: ['2018年总量', '2018年增长率', '2017年总量', '2017年增长率'],
                top: '50',
                textStyle: {
                    color: '#fff',
                    fontSize: 20
                },
            }, ],
            xAxis: {
                data: ['第一季度', '第二季度', '第三季度', '第四季度'],
                axisLabel: {
                    color: "#fff",
                    fontSize: 20
                },
                axisTick: {
                    show: false
                },
            },
            yAxis: [{
                    type: 'value',
                    axisLine: {
                        show: false
                    },
                    axisTick: {
                        show: false
                    },
                    axisLabel: {
                        formatter: '{value}亿元',
                        color: '#fff',
                        fontSize: 20
                    },
                    splitLine: {
                        show: false
                    }
                },
                {
                    type: 'value',
                    axisLabel: {
                        formatter: '{value}%',
                        color: '#fff',
                        fontSize: 20

                    },

                    axisTick: {
                        show: false
                    },
                    axisLine: {
                        show: false,
                    },
                    splitLine: {
                        show: false
                    }
                }
            ],
            series: [{
                    animationDuration: 5000,
                    name: '2017年增长率',
                    type: 'line',
                    yAxisIndex: 1,
                    data: [8.2, 9, 8.16, 9.6],
                    color: '#FFFFFF',
                    symbol: "circle", //设定为实心点
                    symbolSize: 10, //设定实心点的大小
                },
                {
                    animationDuration: 5000,
                    name: '2018年增长率',
                    type: 'line',
                    yAxisIndex: 1,
                    data: [9, 8.4, 8.6, 8.1, ],
                    color: '#5AFF62',
                    symbol: "circle", //设定为实心点
                    symbolSize: 10, //设定实心点的大小
                },
                {
                    animationDuration: 5000,
                    name: '2018年总量',
                    type: 'bar',
                    data: [19.6039, 68.88362, 114.4068, 184.6081],
                    color: '#1CA2FF',
                    barWidth: 20
                },
                {
                    animationDuration: 5000,
                    name: '2017年总量',
                    type: 'bar',
                    data: [17.2126, 55.5837, 95.8103, 165.8613],
                    color: '#8699A7', //0098d9
                    barWidth: 20
                }
            ]
        };
        echarts.init(document.getElementById('gdp')).setOption(option)
    }
    gdp();

    var visit = function () {
        var option = {
            title: {
                text: '县领导走访挂钩联系企业次数与反馈问题',
                textStyle: {
                    fontSize: 24,
                    color: '#fff',
                    fontWeight: 100
                },
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow',
                    label: {
                        backgroundColor: '#6a7985'
                    }
                },
                textStyle: {
                    fontSize: 22
                }
            },
            grid: {
                top: '30%',
                left: '0%',
                right: '0%',
                bottom: '0%',
                containLabel: true
            },
            legend: [{
                x: 'center',
                data: ['走访次数', '反馈问题'],
                top: '50',
                textStyle: {
                    color: '#fff',
                    fontSize: 20
                }
            }, ],
            xAxis: {
                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
                axisLabel: {
                    color: "#fff",
                    interval: 0,
                    fontSize: 20
                },
                axisTick: {
                    show: false
                },
            },
            yAxis: [{
                type: 'value',
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    formatter: '{value}次',
                    color: '#fff',
                    fontSize: 20
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: '#1A2744',
                        width: 1,
                        type: 'solid'
                    }
                }
            }],
            series: [{
                    animationDuration: 5000,
                    name: '走访次数',
                    type: 'bar',
                    data: [91, 98, 78, 78, 86, 83, 70, 75, 73, 78, 75, 83, ],
                    color: '#5AFFB7',
                    barWidth: 10
                },
                {
                    animationDuration: 5000,
                    name: '反馈问题',
                    type: 'bar',
                    data: [153, 162, 132, 137, 130, 138, 137, 137, 137, 137, 137, 137],
                    color: '#FF5A5A', //0098d9
                    barWidth: 10
                }
            ]
        };
        echarts.init(document.getElementById('visit')).setOption(option)
    }
    visit();

    var supervision = function () {
        var option = {
            title: {
                text: '各月督查信息处理率',
                textStyle: {
                    fontSize: 24,
                    color: '#fff',
                    fontWeight: 100
                },
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow',
                },
                textStyle: {
                    fontSize: 22
                }
            },
            grid: {
                top: '30%',
                left: '0%',
                right: '0%',
                bottom: '0%',
                containLabel: true
            },
            legend: [{
                x: 'center',
                data: ['预警处理率', '督查处理率', '督查完成率', '督查考评率'],
                top: '50',
                textStyle: {
                    color: '#fff',
                    fontSize: 20
                },
            }, ],
            xAxis: {
                data: ['1月', '2月', '3月', '4月'],
                axisLabel: {
                    color: "#fff",
                    interval: 0,
                    fontSize: 20

                },
                axisTick: {
                    show: false
                },
            },
            yAxis: [{
                type: 'value',
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    formatter: '{value}%',
                    color: '#fff',
                    fontSize: 20
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: '#1A2744',
                        width: 1,
                        type: 'solid',
                    },

                },

            }],
            series: [{
                    animationDuration: 5000,
                    name: '预警处理率',
                    smooth: true, //这个是把线变成曲线
                    symbol: "circle", //设定为实心点
                    symbolSize: 10, //设定实心点的大小
                    type: 'line',
                    data: [73.5, 90.5, 73.5, 89.5],
                    color: '#16C0FF',
                    lineStyle: {
                        normal: {
                            width: 4
                        }
                    }
                },
                {
                    animationDuration: 5000,
                    name: '督查处理率',
                    smooth: true, //这个是把线变成曲线
                    symbol: "circle", //设定为实心点
                    symbolSize: 10, //设定实心点的大小
                    type: 'line',
                    data: [93.07, 94.08, 79.5, 87.6],
                    color: '#FF5A5A', //0098d9
                    lineStyle: {
                        normal: {
                            width: 4
                        }
                    }
                },
                {
                    animationDuration: 5000,
                    name: '督查完成率',
                    smooth: true, //这个是把线变成曲线
                    symbol: "circle", //设定为实心点
                    symbolSize: 10, //设定实心点的大小
                    type: 'line',
                    data: [85.1, 91.93, 85, 91.5],
                    color: '#FFDE5A', //0098d9
                    lineStyle: {
                        normal: {
                            width: 4
                        }
                    }
                },
                {
                    animationDuration: 5000,
                    name: '督查考评率',
                    smooth: true, //这个是把线变成曲线
                    symbol: "circle", //设定为实心点
                    symbolSize: 10, //设定实心点的大小
                    type: 'line',
                    data: [89.03, 93.98, 93, 96.3],
                    color: '#5AFF62', //0098d9
                    lineStyle: {
                        normal: {
                            width: 4
                        }
                    }
                }
            ]
        };
        echarts.init(document.getElementById('supervision')).setOption(option)
    }
    supervision();
})